OpenLDAP Multi-Master Replication
2015/11/01 |
Configure OpenLDAP Multi-Master Replication.
For the Settings of Provider/Consumer, it's impossible to add datas on Consumer server, but if configure this Multi-Master Settings, it's possbile to add on any Master server. |
|
[1] | |
[2] | Configure like follows on all servers. Add syncprov module. |
root@slapd01:~#
vi mod_syncprov.ldif # create new dn: cn=module,cn=config objectClass: olcModuleList cn: module olcModulePath: /usr/lib/ldap olcModuleLoad: syncprov.la ldapadd -Y EXTERNAL -H ldapi:/// -f mod_syncprov.ldif SASL/EXTERNAL authentication started SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth SASL SSF: 0 adding new entry "cn=module,cn=config"
root@slapd01:~#
vi syncprov.ldif # create new dn: olcOverlay=syncprov,olcDatabase={1}hdb,cn=config objectClass: olcOverlayConfig objectClass: olcSyncProvConfig olcOverlay: syncprov olcSpSessionLog: 100 ldapadd -Y EXTERNAL -H ldapi:/// -f syncprov.ldif SASL/EXTERNAL authentication started SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth SASL SSF: 0 adding new entry "olcOverlay=syncprov,olcDatabase={1}hdb,cn=config" |
[3] | Configure like follows on all servers. But only the parameters "olcServerID" and "provider=***", set different value on each server. |
root@slapd01:~#
vi master01.ldif # create new dn: cn=config changetype: modify replace: olcServerID # specify uniq ID number on each server olcServerID: 101 dn: olcDatabase={1}hdb,cn=config changetype: modify add: olcSyncRepl olcSyncRepl: rid=001 # specify another LDAP server's URI provider=ldap://10.0.0.51:389/ bindmethod=simple # own domain name binddn="cn=admin,dc=srv,dc=world" # directory manager's password credentials=password searchbase="dc=srv,dc=world" # includes subtree scope=sub schemachecking=on type=refreshAndPersist # [retry interval] [retry times] [interval of re-retry] [re-retry times] retry="30 5 300 3" # replication interval interval=00:00:05:00 - add: olcMirrorMode olcMirrorMode: TRUE dn: olcOverlay=syncprov,olcDatabase={1}hdb,cn=config changetype: add objectClass: olcOverlayConfig objectClass: olcSyncProvConfig olcOverlay: syncprov ldapmodify -Y EXTERNAL -H ldapi:/// -f master01.ldif SASL/EXTERNAL authentication started SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth SASL SSF: 0 modifying entry "cn=config" modifying entry "olcDatabase={1}hdb,cn=config" adding new entry "olcOverlay=syncprov,olcDatabase={1}hdb,cn=config" |
[4] | Configure LDAP Client to bind all LDAP server. |
root@www:~#
vi /etc/ldap.conf # line 30: add LDAP Master servers uri ldap://slapd01.srv.world/ ldap://slapd02.srv.world/
|